package com.dhcc.DRGsHosp.web.controller;

import java.util.HashMap;
import java.util.Map;

import org.openkoala.koala.commons.InvokeResult;
import org.openkoala.security.shiro.CurrentUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.dhcc.DRGsHosp.facade.DepCliMonitorFacade;
import com.dhcc.DRGsHosp.facade.DepDisMonitorFacade;
import com.dhcc.DRGsHosp.infra.util.StringUtils;

@Controller("drgsHospWebController7")
@RequestMapping("/DepDisMonitor")
public class DepDisMonitorContorller {

	@Autowired
	private DepDisMonitorFacade depDisMonitorFacade;
	@Autowired
	private DepCliMonitorFacade depCliMonitorFacade;
	
	/**
	 * 
	 * @methodname    :getUserInfo
	 * @description   : 获取登录用户信息
	 * @param         :
	 * @author        :WangTeng
	 * @return        :
	 * @date          :2015年5月19日
	 */
	@ResponseBody
	@RequestMapping(value = "/getUserInfo", method = RequestMethod.POST)
	public InvokeResult getUserInfo() {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("userAccount", CurrentUser.getUserAccount());
		map.put("roleName", CurrentUser.getRoleName());
		String depCode = CurrentUser.getDeps();
		map.put("depCode",depCode);
		map.put("depName", CurrentUser.getDepName());
		return InvokeResult.success(map);
	}
	
	@ResponseBody
	@RequestMapping(value = "/getDepGroupInfo", method = RequestMethod.POST)
	public InvokeResult getDepGroupInfo(String depCode) {
		return InvokeResult.success(depDisMonitorFacade.getDepGroup(depCode));
	}
	
}
